<?php

// 获取会员基本信息
// GET member.baseInfo

namespace app\api\resource\member;
use think\Db;
use think\Session;

class BaseInfo
{
    // 方法
    public $_method = ['GET'];
    // 前置
    public $_pre    = ['login'];
    // 描述
    public $_description = '获取会员基本信息';
    // 参数
    public $_param  = [
        'model' => '模式,0-基本信息|1-完整信息',
    ];
    // 返回
    public $_return = [
        200 => '获取成功',
    ];

    public function run(&$request)
    {
        $model = $request->get('model/d',0,'abs');
        $member = Session::get('member');
        if (1 == $model) {
            $member['info'] = Db::name('member_info')->where('member_id',$member['id'])->find();
        }
        return [200,$member];
    }
}